#include <cdroid.h>
#include "page_base.h"
#include "RecyclerViewAdapter.h"

const std::vector<std::string> __imageDirs__ = {
    "@mipmap/pic_changwenshui",
    "@mipmap/pic_feishui",
    "@mipmap/pic_fengmishui",
    "@mipmap/pic_gouji",
    "@mipmap/pic_huacha",
    "@mipmap/pic_kafei",
    "@mipmap/pic_lengshui",
    "@mipmap/pic_lvcha",
    "@mipmap/pic_ningmengshui",
    "@mipmap/pic_paonai",
    "@mipmap/pic_wulong"
};

typedef enum
{
    MODE_ADD = 1,   // 新增
    MODE_MODIFY = 2 // 修改
} modeAction;

class PageModeAdd : public PageBase
{
private:
    ViewGroup *thisLayout;
    int dataPos;

    TextView *modeMgr;
    ImageView *back;
    ImageView *home;
    ViewGroup *modePic;
    TextView *modeName;
    TextView *temperature;
    TextView *chuShuiLiang;
    std::vector<ModeData> modeDataList;
    ImageView *changePic;
    ImageView *tempJian;
    ImageView *tempJia;
    ImageView *chuShuiJian;
    ImageView *chuShuiJia;
    ViewGroup *submit;
    ImageView *deleteMode;

    ModeData changeModeData;
    RecyclerViewAdapter *mRv;

public:
    ModeData *modeData;

    PageModeAdd(ViewGroup *wind_page_box, int actionType, int position, pageType type);
    ~PageModeAdd();

    void loadPageInfo();
    void setOnClickListenerMethod();
    virtual void startPageAction(pageType type, int position) override;
};
